﻿namespace DueDatePickerSample
{
    using Microsoft.Phone.Controls;
    using System;
    using System.ComponentModel;
    using System.Runtime.CompilerServices;

    public partial class MainPage : PhoneApplicationPage, INotifyPropertyChanged
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private DateTime? dueDateTime;
        public DateTime? DueDateTime
        {
            get
            {
                return this.dueDateTime;
            }

            set
            {
                this.dueDateTime = value;
                this.NotifyPropertyChanged();
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
        {
            var propertyChangedCopy = this.PropertyChanged;
            if (propertyChangedCopy != null)
            {
                propertyChangedCopy(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}